package net.stogi.unicore.beyond.ui.client.taskeditor.taskpreview;

import net.stogi.unicore.beyond.api.model.OutputType;

import com.google.gwt.event.shared.GwtEvent;

public class AddOutputDefinitionEvent extends GwtEvent<AddOutputDefinitionHandler> {

	public static final GwtEvent.Type<AddOutputDefinitionHandler> TYPE = new GwtEvent.Type<AddOutputDefinitionHandler>();

	private OutputType outputType;

	public AddOutputDefinitionEvent(OutputType outputType) {
		this.outputType = outputType;
	}

	@SuppressWarnings("unused")
	private AddOutputDefinitionEvent() {}

	@Override
	public Type<AddOutputDefinitionHandler> getAssociatedType() {
		return TYPE;
	}

	public OutputType getOutputType() {
		return outputType;
	}

	public void setOutputType(OutputType outputType) {
		this.outputType = outputType;
	}

	@Override
	protected void dispatch(AddOutputDefinitionHandler handler) {
		handler.onAddOutputDefinition(this);
	}
}
